{% extends 'index.html' %}
{% block page-content %}
<div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><i class="fa  fa-signal"></i> 设备资产详细内容</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           	 <i class="fa fa-institution    fa-fw"></i> 总资产
                        </div>
                        <div class="panel-body">
							<div class="list-group">
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-th-list fa-fw"></i> 设备类型
                                    <span class="pull-right text-muted small">
                                     		 {% if asset_main.assets_type == "server" %}
									         		<code>服务器</code>
									         {% elif asset_main.assets_type == "vmser" %}
									         		<code>虚拟机</code>
									         {% elif asset_main.assets_type == "switch" %}
									         		<code>交换机</code>							         				
									         {% elif asset_main.assets_type == "route" %}
									         		<code>路由器</code>
									         {% elif asset_main.assets_type == "printer" %}
									         		<code>打印机</code>	
									         {% elif asset_main.assets_type == "scanner" %}
									         		<code>扫描仪</code>	
									         {% elif asset_main.assets_type == "firewall" %}
									         		<code>防火墙</code>
									         {% elif asset_main.assets_type == "storage" %}
									         		<code>存储设备</code>
									         {% elif asset_main.assets_type == "wifi" %}
									         		<code>无线设备</code>							         													         												         												         											         												         			
									         {% endif %}
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-heart fa-fw"></i> 资产编号
                                    <span class="pull-right text-muted small"><em>{{ asset_main.name|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-envelope fa-fw"></i> 设备序列号
                                    <span class="pull-right text-muted small"><em>{{ asset_main.sn|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-tasks fa-fw"></i> 购买时间
                                    <span class="pull-right text-muted small"><em>{{ asset_main.buy_time|date:"Y/m/d" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-upload fa-fw"></i> 过保时间
                                    <span class="pull-right text-muted small"><em>{{ asset_main.expire_date|date:"Y/m/d" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa  fa-users fa-fw"></i> 购买人
                                    <span class="pull-right text-muted small">
                                    	<em>
                                    		{% for user in userList %}
												{% if asset_main.buy_user == user.id %}
														{{user.username}}
												{% endif %}   
											{% endfor %}                                 		
                                    	</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="glyphicon glyphicon-globe  "></i> 管理IP
                                    <span class="pull-right text-muted small"><code>{{ asset_main.management_ip|default:"" }}</code>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-car fa-fw"></i>制造商
                                    <span class="pull-right text-muted small"><em>{{ asset_main.manufacturer|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-shopping-cart fa-fw"></i>设备型号
                                    <span class="pull-right text-muted small"><em>{{ asset_main.model|default:"" }}</em>
                                    </span>
                                </a>                                
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-credit-card  fa-fw"></i> 供货商
                                    <span class="pull-right text-muted small"><em>{{ asset_main.provider|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-terminal fa-fw"></i> 设备状态
                                    <span class="pull-right text-muted small">
									         		{% if asset_main.status == 0 %}
									         			<button  type="button" class="btn btn-outline btn-success btn-xs">已上线</button>
									         		{% elif asset_main.status == 1 %}
									         			<button  type="button" class="btn btn-outline btn-primary btn-xs">已下线</button>
									         		{% elif asset_main.status == 2 %}
									         			<button  type="button" class="btn btn-outline btn-warning btn-xs">维修中</button>
									         		{% elif asset_main.status == 3 %}
									         			<button  type="button" class="btn btn-outline btn-info btn-xs">已入库</button>
									         		{% elif asset_main.status == 4 %}
									         			<button  type="button" class="btn btn-outline btn-default btn-xs">未使用</button>
									         		{% endif %}                                    	
                                    </span>
                                </a>  
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-home fa-fw"></i> 放置区域
                                    <span class="pull-right text-muted small">
                                    {% for z in baseAssets.zone %}
                                    	{% if z.id == asset_main.put_zone %}
                                    		<em>{{ z.zone_name }}</em>
                                    	{% endif %}
                                    {% endfor %}
                                    
                                    </span>
                                </a> 
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-group  fa-fw"></i> 使用组
                                    <span class="pull-right text-muted small">
                                    {% for g in baseAssets.group %}
                                    	{% if g.id == asset_main.group %}
                                    		<em>{{ g.name }}</em>
                                    	{% endif %}
                                    {% endfor %}                                    
                                    </span>
                                </a> 
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-sitemap fa-fw"></i> 所属产品线
                                    <span class="pull-right text-muted small">
                                    {% for s in baseAssets.project %}
                                    	{% if s.id == asset_main.project %}
                                    		<em>{{ s.project_name }}</em>
                                    	{% endif %}
                                    {% endfor %}                                     
                                    </span>
                                </a>                                 
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-check fa-fw"></i> 业务类型
                                    <span class="pull-right text-muted small">
                                    {% for s in baseAssets.service %}
                                    	{% if s.id == asset_main.business %}
                                    		<em>{{ s.service_name }}</em>
                                    	{% endif %}
                                    {% endfor %}                                     
                                    </span>
                                </a>                                                                                                                               
                            </div>                        
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           	 <i class="fa fa-table  fa-fw"></i> 硬件信息
                        </div>
                        <div class="panel-body">
                        {% if asset_type == "server" or asset_type == "vmser" %}
							<div class="list-group">
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-globe fa-fw"></i> 服务器IP地址
                                    <span class="pull-right text-muted small"><code>{{ asset_body.ip|default:"" }}</code>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-graduation-cap  fa-fw"></i> 主机名
                                    <span class="pull-right text-muted small"><em>{{ asset_body.hostname|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-user-md   fa-fw"></i> 管理用户
                                    <span class="pull-right text-muted small"><em>{{ asset_body.username|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-tasks fa-fw"></i> 端口
                                    <span class="pull-right text-muted small"><em>{{ asset_body.port|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-upload fa-fw"></i> 出口线路
                                    <span class="pull-right text-muted small">
                                    {% for s in baseAssets.line %}
                                    	{% if s.id == asset_body.line %}
                                    		<em>{{ s.line_name }}</em>
                                    	{% endif %}
                                    {% endfor %}                                    

                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-bolt fa-fw"></i> CPU类型
                                    <span class="pull-right text-muted small"><em>{{ asset_body.cpu|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-warning fa-fw"></i> 物理CPU个数
                                    <span class="pull-right text-muted small"><em>{{ asset_body.cpu_number|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-shopping-cart fa-fw"></i> 逻辑CPU个数
                                    <span class="pull-right text-muted small"><em>{{ asset_body.vcpu_number|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-location-arrow fa-fw"></i> CPU核心数
                                    <span class="pull-right text-muted small"><em>{{ asset_body.cpu_core|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-hdd-o fa-fw"></i> 磁盘总容量
                                    <span class="pull-right text-muted small"><em>{{ asset_body.disk_total|default:"" }}MB</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-tachometer fa-fw"></i> 内存容量
                                    <span class="pull-right text-muted small"><em>{{ asset_body.ram_total|default:""  }}MB</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa  fa-linux fa-fw"></i> 操作系统
                                    <span class="pull-right text-muted small"><em>{{ asset_body.system|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-apple  fa-fw"></i> 内核版本
                                    <span class="pull-right text-muted small"><em>{{ asset_body.kernel|default:""  }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-cog fa-fw"></i> Selinux状态
                                    <span class="pull-right text-muted small"><em>{{ asset_body.selinux|default:""  }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-trophy fa-fw"></i> Swap容量
                                    <span class="pull-right text-muted small"><em>{{ asset_body.swap|default:""  }}MB</em>
                                    </span>
                                </a>                                                                                                                                                                                                
                            </div>    
                         {% else %}
							<div class="list-group">
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-globe fa-fw"></i> IP地址
                                    <span class="pull-right text-muted small"><code>{{ asset_body.ip|default:"" }}</code>
                                    </span>
                                </a>
                               <a href="#" class="list-group-item">
                                    <i class="fa fa-user-md   fa-fw"></i> 管理用户
                                    <span class="pull-right text-muted small"><em>{{ asset_body.username|default:"" }}</em>
                                    </span>
                                </a>     
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-tasks fa-fw"></i> 端口
                                    <span class="pull-right text-muted small"><em>{{ asset_body.port|default:"" }}</em>
                                    </span>
                                </a>                                                           
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-lightbulb-o fa-fw"></i> CPU型号
                                    <span class="pull-right text-muted small"><em>{{ asset_body.cpu|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-envelope fa-fw"></i> 内存大小
                                    <span class="pull-right text-muted small"><em>{{ asset_body.stone|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-tasks fa-fw"></i> 背板带宽
                                    <span class="pull-right text-muted small"><em>{{ asset_body.bandwidth|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-upload fa-fw"></i> 端口个数
                                    <span class="pull-right text-muted small"><em>{{ asset_body.port_number|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-bolt fa-fw"></i> 固件版本
                                    <span class="pull-right text-muted small"><em>{{ asset_body.firmware|default:"" }}</em>
                                    </span>
                                </a>
                                <a href="#" class="list-group-item">
                                    <i class="fa fa-warning fa-fw"></i> 配置说明
                                    <span class="pull-right text-muted small"><em>{{ asset_body.configure_detail|default:"" }}</em>
                                    </span>
                                </a>                                                                                                                                                                                               
                            </div>                           	
                         {% endif %}                    
                        </div>
                    </div>
                </div>    
                <div class="col-lg-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <i class="fa fa-keyboard-o  fa-fw"></i> 网卡信息
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>网卡名称</th>
                                            <th>IP地址</th>
                                            <th>Mac地址</th>
                                            <th>网卡类型</th>
                                            <th>MTU</th>
                                            <th>状态</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    	{% for ds in asset_nks %}
                                        <tr>
                                            <td>{{ds.device}}</td>
                                            <td>{{ds.ip}}</td>
                                            <td>{{ds.macaddress}}</td>
                                            <td>{{ds.module}}</td>
                                            <td>{{ds.mtu}}</td>
                                            <td>{% if ds.active == 1 %}<button type="button" class="btn btn-success btn-xs">on</button> {% else %} <button type="button" class="btn btn-danger btn-xs">down</button> {% endif %}</td>
                                            
                                        </tr>
                                        {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="panel-footer">
                        </div>
                    </div>
                </div>                            
             </div>
            {% if asset_type == "server" %}
            <div class="row">
                <div class="col-lg-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           	 <i class="fa fa-table  fa-fw"></i> 内存详细信息
                        </div>
                        <div class="panel-body">
								 <table class="table table-bordered table-hover table-striped tablesorter">	
								 	<tbody>								 	
								 		<tr>
								 			<th>插槽号</th>
								 			<th>内存型号</th>
								 			<th>容量</th>			
								 			<th>内存厂商</th>								 			
								 			<th>状态</th>									 								 			
								 		</tr>								 			
								 		
								 		{% for ram in asset_ram %}
								 			<tr>
								 			   <td>
								 			   	 {{ ram.device_slot }}
								 			   </td>								 			
								 			   <td>
								 			   	 {{ ram.device_model }}
								 			   </td>
								 			   	<td>
								 			   	 {{ ram.device_volume }}
								 			   </td>
								 			   	<td>
								 			   	 {{ ram.device_brand }}
								 			   </td>
								 			   	<td>
								 			   	<u>
								 			   	 {{ ram.device_status }}
								 			   	</u>
								 			   </td>								 			   								 			   								 			   
								 			</tr>
								 		{% endfor %}
								 	</tbody>
								 </table>
								 {% if  asset_body.ram_total %}
				                <div class="text-right">
				                  <a href="#"><i class="fa fa-arrow-circle-right"></i>内存容量： {{ asset_body.ram_total }} MB</a>
				                </div>
				                {% endif %}									                         
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           	 <i class="fa fa-table  fa-fw"></i> 硬盘信息信息
                        </div>
                        <div class="panel-body">
								 <table class="table table-bordered table-hover table-striped tablesorter">	
								 	<tbody>								 	
								 		<tr>
								 			<th>序号</th>
								 			<th>硬盘类型</th>
								 			<th>容量</th>			
								 			<th>硬盘型号</th>
								 			<th>厂家</th>
								 			<th>状态</th>									 								 			
								 		</tr>								 			
								 		
								 		{% for disk in asset_disk %}
								 			<tr>
								 			   <td>
								 			   	 {{ disk.id }}
								 			   </td>								 			
								 			   <td>
								 			   	 {{ disk.device_model }}
								 			   </td>
								 			   	<td>
								 			   	 {{ disk.device_volume }}
								 			   </td>
								 			   	<td>
								 			   	 {{ disk.device_name }}
								 			   </td>
								 			   	<td>
								 			   	 {{ disk.device_brand }}
								 			   </td>
								 			   	<td>
								 			 	<u>
								 			   	 {{ disk.device_status }}
								 			   	</u>
								 			   </td>								 			   								 			   								 			   
								 			</tr>
								 		{% endfor %}
								 	</tbody>
								 </table>
								 {% if  asset_body.raid %}
				                <div class="text-right">
				                  <a href="#"><i class="fa fa-arrow-circle-right"></i>
                                    {% for r in baseAssets.raid %}
                                    	{% if r.id == asset_body.raid %}
                                    		Raid类型： {{ r.raid_name }}
                                    	{% endif %}
                                    {% endfor %} 				                  
				                  </a>
				                </div>
				                {% endif %}                       
                        </div>
                    </div>
                </div>                
             </div>    
            {% endif %}         
</div>
{% endblock %}